<%- @page_title = _('Join %s', h(@teaching.title)) -%>
<h2><%= @page_title %></h2>
<%- form_tag( confirm_join_class_path,
              :class => 'form-small',
              :onsubmit => "Field.disable('submit-form'); Element.hide('cancel-form');") do -%>
  <div class="form"><!--O .form-->
    <label for="existing_group"><%= _('You can join an existing group') %>: <!-- <span class="quick-tip"><%= _("(requires confirmation)") %></span> --></label>
    <%= select_tag('group', options_for_select([[_("Pick a group")]] + @teaching.groups.map {|g| [g.name, g.id]}),
                    :id => 'existing_group') %>
  </div><!--C .form-->
  <div class="form"><!--O .form-->
    <label for="new_group"><%= _('Or you can create a new group') %>:</label>
    <%= text_field_tag('new_group', params[:new_group], :class => 'textfield', :id => 'new_group') %>
    <%= error_message_on(:group, :name) %>
  </div><!--C .form-->
  <div class="form"><!--O .form-->
    <%= submit_tag(_('Join Class'), :class => 'button', :id => 'submit-form') %>
    <%= link_to(_('&laquo; Back to class'), class_path(@project, @teaching), :id => 'cancel-form') %>
  </div><!--C .form-->
<%- end -%>